<!-- PAGE CONTENT WRAPPER -->
<div class="page-content-wrap">

    <div class="row">
        <div style="background: #ffffff;">

            <form class="form-horizontal" name="addTSForm" novalidate>
                <div class="panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><strong>{{'新增课程任务' | dyLanguage}}</strong></h3>
                        <!--<ul class="panel-controls">-->
                        <!--<li><a href="javascript:void(0)" class="panel-remove"><span class="fa fa-times"></span></a></li>-->
                        <!--</ul>-->
                    </div>
                    <div class="panel-body panel-dialog">
                        <p>{{'请按照提示输入课程任务的各项信息。' | dyLanguage}}</p>

                        <div class="form-group">
                            <label class="col-md-3 col-xs-12 control-label">{{'标题' | dyLanguage}}</label>

                            <div class="col-md-6 col-xs-12">
                                <div class="input-group">
                                    <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                    <input type="text" class="form-control" name="subject" ng-model="currentTask.subject" required/>
                                </div>
                                <span class="help-block" ng-show="(addTSForm.subject.$untouched && !addTSForm.$submitted) || addTSForm.subject.$valid">{{'请输入标题' | dyLanguage}}</span>

                                <div ng-show="(addTSForm.subject.$touched || addTSForm.$submitted ) && addTSForm.subject.$invalid">
                                    <span class="error-block" ng-show="addTSForm.subject.$error.required">{{'必须要输入标题' | dyLanguage}}</span>
                                </div>
                            </div>
                        </div>


                        <div class="form-group">
                            <label class="col-md-3 col-xs-12 control-label">{{'内容' | dyLanguage}}</label>

                            <div class="col-md-6 col-xs-12">
                                <textarea class="form-control" rows="5" ng-model="currentTask.content"></textarea>
                                <span class="help-block">{{'请输入内容' | dyLanguage}}</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-3 col-xs-12 control-label">{{'序号' | dyLanguage}}</label>

                            <div class="col-md-6 col-xs-12">
                                <div class="input-group">
                                    <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                    <input type="number" class="form-control" name="sort" ng-model="currentTask.sort" required/>
                                </div>
                                <span class="help-block" ng-show="(addTSForm.sort.$untouched && !addTSForm.$submitted) || addTSForm.sort.$valid">{{'请输入课程任务的序号' | dyLanguage}}</span>

                                <div ng-show="(addTSForm.sort.$touched || addTSForm.$submitted ) && addTSForm.sort.$invalid">
                                    <span class="error-block" ng-show="addTSForm.sort.$error.required">{{'必须要输入课程任务的序号' | dyLanguage}}</span>
                                    <span class="error-block" ng-show="addTSForm.sort.$error.pattern">{{'必须是大于零的整数' | dyLanguage}}</span>
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-3 col-xs-12 control-label">{{'是否必须完成' | dyLanguage}}</label>
                            <label class="switch switch-small">
                                <input ng-checked="currentTask.required" ng-click="updateSelection($event, currentTask.required)" type="checkbox" ng-model="currentTask.required"/>
                                <span></span>
                            </label>
                        </div>

                        <div class="form-group">
                            <label class="col-md-3 col-xs-12 control-label">{{'是否需要审批' | dyLanguage}}</label>
                            <label class="switch switch-small">
                                <input ng-checked="currentTask.approve" ng-click="updateSelection($event, currentTask.approve)" type="checkbox" ng-model="currentTask.approve"/>
                                <span></span>
                            </label>
                        </div>

                    </div>
                    <div class="panel-footer" style="text-align: center;">
                        <button class="btn btn-danger" ng-click="cancel()"><i class="fa fa-times"></i>{{'关闭' | dyLanguage}}</button>
                    </div>
                </div>
            </form>

        </div>
    </div>

</div>
<!-- END PAGE CONTENT WRAPPER -->